package com.itqian.seller.service;

import com.itqian.seller.dto.BarDTO;
import com.itqian.seller.entity.OrderMaster;
import com.baomidou.mybatisplus.extension.service.IService;
import com.itqian.seller.vo.OrderVO;
import org.apache.commons.lang3.StringUtils;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 订单主表 服务类
 * </p>
 *
 * @author shishuqian
 * @since 2022-03-21
 */
public interface OrderMasterService extends IService<OrderMaster> {

    /**
     *
     * @author shishuqian
     * @desc  storeId != null 根据店铺id分页查询该店铺的所有订单（用户已完成支付的）
     *        storeId == null 管理员查询所有订单
     */
    Map<String, Object> list(Integer storeId,Integer page,Integer size);

    /**
     *
     * @author shishuqian
     * @desc  根据订单id删除订单(将seller_deleted置为true)
     */
    //string -> int
    boolean delete(Integer orderId);

    /**
     *
     * @author shishuqian
     * @desc  管理员根据订单id删除订单(buyer_deleted,seller_deleted,runner_deleted,admin_deleted都置为true)
     */
    //string -> int
    boolean adminDelete(Integer orderId);


    /**
     *
     * @author shishuqian
     * @desc  storeId != null 分页模糊查询该店铺的订单
     * storeId == null，按条件查询所有订单
     * @Param  param1:店铺id  param2:当前页  param3:查询条数  param4:查询类型  param5:查询关键字
     */
    Map<String, Object> like(Integer storeId, Integer page, Integer size, String type, String keyword);


    /**
     *
     * @author shishuqian
     * @desc   根据订单id查询该订单的详细信息
     */
    // 改为int类型
    OrderVO detail(Integer orderId);

    /**
     *
     * @author shishuqian
     * @desc   查看店铺菜品分类销量
     */
    List<BarDTO> categoryBar(Integer storeId);
}
